package com.pawan;
interface StudentDAO{
	public void addStudent();
}
class HibernateStudent implements StudentDAO{

	@Override
	public void addStudent() {
		System.out.println("addStudent()");
		
	}
	
}
class DAOFactory{
	static StudentDAO sdao;
	static{
		sdao=new HibernateStudent();
	}
	public static StudentDAO getFactory(){
		return sdao;
	}
}
interface StudentService{
	public void addMyStudent();
}
class StudentServiceImpl implements StudentService{
	//StudentDAO sdao=new JDBCStudent();
	DAOFactory daof=new DAOFactory();
	@Override
	public void addMyStudent() {
		
		//sdao.addStudent();
		daof.getFactory().addStudent();
	}
	
}
public class TestExample {
public static void main(String[] args) {
	StudentService simpl=new StudentServiceImpl();
	simpl.addMyStudent();
}
}
